<template>
  <div>
    <el-row>
      <el-col :span="18">
        <!-- 工单统计 -->
        <el-col :span="12">
          <el-card class="work-bigbox"
                   style="
              height: 210px;
              margin-right: 15px;
              padding-left: 10px;
              padding-right: 10px;
            ">
            <!-- <i class="el-icon-user"></i> -->
            <h5 class="tit">运营人员（当天）</h5>
            <div class="work-box">
              <div class="work">
                <h2 class="num">6</h2>
                <p class="tag1">工单总数(个)</p>
              </div>
              <div class="work">
                <h2 class="num">0</h2>
                <p class="tag1">完成工单(个)</p>
              </div>
              <div class="work">
                <h2 class="num">1</h2>
                <p class="tag1">进行工单(个)</p>
              </div>
              <div class="work">
                <h2 class="num">16</h2>
                <p class="tag1">取消工单(个)</p>
              </div>
            </div>
          </el-card>
        </el-col>
        <el-col :span="12">
          <el-card class="a1"
                   style="
              height: 210px;
              margin-right: 15px;
              padding-left: 10px;
              padding-right: 10px;
            ">
            <!-- <i class="el-icon-user"></i> -->
            <h5 class="tit">运维人员（当天）</h5>
            <div class="work-box">
              <div class="work">
                <h2 class="num">12</h2>
                <p class="tag1">工单总数(个)</p>
              </div>
              <div class="work">
                <h2 class="num">0</h2>
                <p class="tag1">完成工单(个)</p>
              </div>
              <div class="work">
                <h2 class="num">6</h2>
                <p class="tag1">进行工单(个)</p>
              </div>
              <div class="work">
                <h2 class="num">12</h2>
                <p class="tag1">取消工单(个)</p>
              </div>
            </div>
          </el-card>
        </el-col>
      </el-col>

      <el-col :span="17"
              style="
          margin-top:20px
          ">
        <el-card style="
            height: 700px;
            margin-right: 15px;
            padding-left: 10px;
            padding-right: 10px;
          ">
          <div class="topwork">
            <h5 class="tit">工单状态</h5>
            <div class="bottomwork">
              <div class="block">

                <el-date-picker v-model="value1"
                                type="daterange"
                                align="center"
                                range-separator="至"
                                start-placeholder="开始日期"
                                end-placeholder="结束日期">
                </el-date-picker>
              </div>
              <div class="week-month-year">
                <div class="item item111">周</div>
                <div class="item">月</div>
                <div class="item">年</div>
              </div>
            </div>
          </div>
          <div class="nodata"><img src="https://likede2-admin.itheima.net/img/empty.87c4f71b.png"
                 alt="">
            <p>暂无数据</p>
          </div>
        </el-card>
      </el-col>

      <el-col :span="7"
              style="
          margin-top:20px
          ">
        <el-card style="
            height: 700px;
            margin-right: 15px;
            padding-left: 10px;
            padding-right: 10px;
          ">
          <div class="people_top">
            <div>
              <h5 class="tit">人效排名（月度）</h5>
            </div>
            <div>
              <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                  全部<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item>城北街道</el-dropdown-item>
                  <el-dropdown-item>西直门街道</el-dropdown-item>
                  <el-dropdown-item>建材城</el-dropdown-item>
                  <el-dropdown-item>金燕龙</el-dropdown-item>
                  <el-dropdown-item>霍营街道</el-dropdown-item>
                  <el-dropdown-item>西北平溪府街道</el-dropdown-item>
                  <el-dropdown-item>北京前门街道</el-dropdown-item>
                  <el-dropdown-item>霍营街道</el-dropdown-item>
                  <el-dropdown-item>霍营街道</el-dropdown-item>
                  <el-dropdown-item>霍营街道</el-dropdown-item>
                  <el-dropdown-item>霍营街道</el-dropdown-item>

                </el-dropdown-menu>
              </el-dropdown>
            </div>

          </div>
          <div class="member">
            <div class="member1">
              <span class="sp111sp">运营成员</span>
              <span class="sp222sp">运维成员</span>
            </div>
          </div>
          <div class="nodata"><img src="https://likede2-admin.itheima.net/img/empty.87c4f71b.png"
                 alt="">
            <p>暂无数据</p>
          </div>

        </el-card>
      </el-col>

    </el-row>
  </div>
</template>

<script>
export default {
  name: 'UserCount',
  data () {
    return {
      workList: [],
      sales: '',
      Partners: '',
      Point: [],
      classLister: [],
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近一个月',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近三个月',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
      value1: [new Date(2022, 10, 28, 10, 10), new Date(2022, 11, 1, 10, 10)],
      value2: ''

    }
  },
  methods: {

  },
  computed: {
    workSum () {
      return this.workList.reduce((sum, item) => {
        sum += item.total
        return sum
      }, 0)
    },
    defaultSum () {
      return this.workList.reduce((sum, item) => {
        sum += item.cancelTotal
        return sum
      }, 0)
    },
    workerCount () {
      return this.workList.reduce((sum, item) => {
        sum += item.workerCount
        return sum
      }, 0)
    },
    completedTotal () {
      return this.workList.reduce((sum, item) => {
        sum += item.completedTotal
        return sum
      }, 0)
    },
    salesNum () {
      return this.sales.data / 1000000
    },
    PartnersNum () {
      return this.Partners.data
    }
  },
  async created () {
    // const work = await getCooperation()
    // console.log(work.data)
    // this.workList = work.data
    // await getfault()
    // const Partners = await getPartners()
    // this.Partners = Partners
    // const Point = await getPoint()
    // this.Point = Point
    // const sale = await getsale()
    // this.classLister = sale.data
    // console.log(this.classLister)

    // const sales = await getSales()
    // this.sales = sales
  }
}
</script>

<style lang="scss" scoped>
.member {
  display: flex;
  justify-content: center;

  .member1 {
    width: 200px;
    text-align: center;
    font-size: 14px;

    height: 30px;
    line-height: 30px;
    background-color: #f8faff;
    .sp111sp {
      background: #fff;
      width: 80px;
      text-align: center;
      cursor: pointer;
      height: 22px;
      line-height: 22px;
      -webkit-box-shadow: 0 0 4px 0 rgb(0 0 0 / 11%);
      box-shadow: 0 0 4px 0 rgb(0 0 0 / 11%);
      border-radius: 7px;
      // font-weight: 600;
      color: #333;
      display: inline-block;
    }
    .sp222sp {
      text-align: center;

      border-radius: 7px;
      color: #ccd0da;
      cursor: pointer;

      display: inline-block;
      margin-left: 10px;
    }
  }
}
.people_top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bottomwork {
  display: flex;
}
.week-month-year {
  margin-left: 20px;
  display: inline-block;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}
.item {
  text-align: center;
  width: 37px;
  height: 25px;
  font-size: 14px;
  line-height: 26px;
  color: #9ca3b4;
  cursor: pointer;
}

.item111 {
  background-color: rgb(216, 213, 213);
  border-radius: 10px;
}

.topwork {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.nodata {
  display: flex;
  height: 540px;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  img {
    width: 123px;
    height: 96px;
  }
}
::v-deep {
  .el-icon--right {
    margin-left: 24px;
  }
  .el-dropdown {
    border: 1px solid#ccc;
    // width: 100px !important;
    padding: 5px 5px 5px 10px;
    border-radius: 5px;
    // height: 30px !important;
    text-align: center;
    // line-height: 30px;
  }
  .el-dropdown-link {
    cursor: pointer !important;
  }
  .el-col-18 {
    width: 100%;
  }
  .el-date-editor--daterange.el-input,
  .el-date-editor--daterange.el-input__inner,
  .el-date-editor--timerange.el-input,
  .el-date-editor--timerange.el-input__inner {
    width: 310px !important;
    height: 30px;
  }
  .el-date-editor .el-range__icon {
    line-height: 22px !important;
  }
  .el-date-editor .el-range-separator {
    line-height: 21px !important;
  }
  .el-date-editor .el-range__close-icon {
    line-height: 20px !important;
  }
}
.list {
  height: 510px;
  .title {
    display: flex;
    align-items: center;
    padding: 0;
    h4 {
      font-size: 16px;
      color: #333;
    }
    span {
      margin-left: 10px;
      color: #999;
    }
  }
  ul {
    display: flex;
    flex-direction: column;
    margin-left: -30px;
    justify-content: space-around;
    margin-top: -10px;
    height: 460px;
    list-style-type: none;
    padding-left: 30px;
    li {
      .left {
        width: 21px;
        // box-sizing: content-box;

        background: no-repeat
          url();
        background-position: no-repeat center / cover;
        text-align: center;
      }
      .center {
        margin-left: 30px;
      }
      .right {
        text-align: right;
      }
      &:nth-child(1) {
        .left {
          background: no-repeat
            url();
          background-position: no-repeat center / cover;
        }
      }
      &:nth-child(2) {
        .left {
          background: no-repeat
            url();
          background-position: no-repeat center / cover;
        }
      }
      &:nth-child(3) {
        .left {
          background: no-repeat
            url();
          background-position: no-repeat center / cover;
        }
      }
    }
  }
}
.aaa {
  display: flex;
}
.a1 {
  background: url('https://img1.baidu.com/it/u=804699875,2624804129&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=323')
    no-repeat center / cover;
}
.work-bigbox {
  background: url(@/assets/bb.webp) no-repeat center / cover;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.work-box {
  display: flex;
}
.work {
  padding-top: 10px;
  padding-left: 30px;
  justify-content: space-around;
  .num {
    font-family: PingFangSC-Semibold, PingFang SC;
    color: #072074;
    font-size: 33px;
    margin: 6px 0;
    text-shadow: 2px 4px 7px rgba(85, 132, 255, 0.5);
  }
  .tag1 {
    padding-top: 5px;
    color: #91a7dc;
    margin: 0;
    font-size: 10px;
  }
}
.dashboard-page {
  .el-breadcrumb {
    margin-top: 10px;
    margin-bottom: 25px;
  }
  .el-card {
    border-radius: 20px;

    margin-bottom: 20px;
    position: relative;
    &.row {
      h4 {
        width: 40%;
        float: left;
        font-size: 18px;
        margin-left: 5%;
      }
      img {
        width: 40%;
        float: left;
        margin-left: 10%;
        margin-top: 30px;
      }
    }
    [class^='el-icon'] {
      font-size: 30px;
      color: #ccc;
      position: absolute;
      right: 25px;
      top: 30px;
      font-weight: bold;
    }
    .tit {
      color: #070707;
      font-size: 16px;
      margin: 0px 0;
      font-weight: 800;
    }

    .tag {
      color: #999;
      margin: 0;
      font-size: 14px;
      > i {
        font-style: normal;
        margin-right: 10px;
        color: rgb(10, 207, 151);
        &.red {
          color: #fa5c7c;
        }
      }
    }
    img {
      width: 100%;
      height: 100%;
    }
    h4 {
      margin: 0;
      padding-bottom: 20px;
      color: #6c757d;
    }
  }
}
</style>
